Repository navigation
feat(sql): add qn sql clusters (DX-7719) - #63
Open
johnpmitsch wants to merge 3 commits into
Open
johnpmitsch wants to merge 3 commits into
johnpmitsch wants to merge 3 commits into
Conversation
SDK 0.10.1 makes the credits value of a SQL query response optional. The stats line of qn sql query now leaves the credits segment out when the response has none, and prints it as before when it is there. Tests: 2 unit tests for the stats line, 1 integration test for a query response without credits.
qn sql clusters (alias ls) lists the clusters that qn sql query and qn sql schema take as a cluster id. It prints an ID / DISPLAY_NAME table by default and the SDK's JSON under -o json. It sends the API key and retries like the other read-only commands. The README and the qn agent context guide list the new command. Tests: 2 integration tests (happy path with the ls alias and the API key header, 401 to exit 2) and 1 table snapshot.
The notes named the SDK minor version the CLI wraps. It is 0.10 after the dependency update.
johnpmitsch
marked this pull request as ready for review
November 16, 2026 05:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tl;dr
Adds
qn sql clusters(aliasls), which lists the clusters thatqn sql queryandqn sql schematake as a cluster ID. Updatesquicknode-sdkto 0.10.1, the release line that hassql.list_clusters().Closes DX-7719
Impact
qn sql clusters/qn sql ls. It prints anID/DISPLAY_NAMEtable by default and the SDK's JSON array under-o json. It sends the API key and retries like the other read-only commands.qn sql query: the stats line on stderr leaves the credits segment out when the response has no credits value (✓ 2 rows · 0.007s). With credits, the line is the same as before (✓ 2 rows · 135 credits · 0.007s).qn sql --helpnow ends with an examples block.Where to focus your review
src/commands/sql/mod.rs,stats_line: the only change to existing behavior. SDK 0.10.1 typesQueryResponse.creditsasOption<i64>.src/commands/sql/mod.rs,clustersandClustersView: the new verb. It followsschema(keyed client,retrying).Cargo.lock(one version and checksum), the snapshot file, the tests.Decisions & tradeoffs
stats_line.qn sqlgets a top-level examples block — the working notes ask for one on every top-level noun, andclustersis the first step of the flow. To reverse: remove theafter_helpattribute onsql::Args.Technical notes
ClustersViewwrapsVec<SqlCluster>, so the serialized formats match the SDK's shape: a bare array of{ id, display_name }.CLAUDE.mdnow namesquicknode-sdk0.10 as the wrapped version.How I verified it
AI: built, tested, and self-reviewed (jreview) by john-pipeline running Claude Code.
Ran:
cargo fmt --checkpassescargo clippy --all-targets -- -D warningspassescargo testpasses (549 tests; 6 new: 2 unit tests for the stats line, 3 integration tests intests/sql.rs, 1 table snapshot)cargo build --releasepasses with no warnings from this cratesql clusters -o json,sql ls -o table,sql ls -o mdprint the two clusters and exit 0; a 401 prints the unauthorized message and exits 2qn sql clustersagainst the live API with a keyNot checked:
qn sql clustersagainst the live API.Confidence assessment: how likely is this to affect or break prod
Overall: low risk of breakage, small blast radius if it does, fully reversible by code revert.
qn sql querystats line{ id, display_name }shape; extra fields are ignoredNot verifiable from here: